﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Zove.Runtime.Logging {
    public class DefaultLogger : ILogger {

        public void ClearAll() {
            this.ErrorMessages.Clear();
            this.WarningMessages.Clear();
        }

        public List<LoggingMessage> ErrorMessages {
            get;
            set;
        }

        public List<LoggingMessage> WarningMessages {
            get;
            set;
        }

        public DefaultLogger() {
            this.ErrorMessages = new List<LoggingMessage>();
            this.WarningMessages = new List<LoggingMessage>();
        }

        #region ILogger Members

        public void LogError(LoggingMessage message) {
            this.ErrorMessages.Add(message);
        }

        public void LogWarning(LoggingMessage message) {
            this.WarningMessages.Add(message);
        }

        public List<LoggingMessage> GetErrorMessages() {
            return this.ErrorMessages;
        }

        public List<LoggingMessage> GetWarningMessages() {
            return this.WarningMessages;
        }

        #endregion
    }
}
